int* decode(int* encoded, int encodedSize, int first, int* returnSize)
{
    int* ans = (int*)malloc(sizeof(int) * (encodedSize + 1));
    int i = 0;
    ans[i] = first;

    for (i = 0;i < encodedSize;++i)
    {
        ans[i + 1] = ans[i] ^ encoded[i];
    }

    *returnSize = encodedSize + 1;
    return ans;

}